import { IPublicTypeComponentMetadata, IPublicTypeSnippet } from '@alilc/lowcode-types';

const RealtimeStatusMeta: IPublicTypeComponentMetadata = {
  componentName: 'RealtimeStatus',
  title: '实时状态',
  category: '信息展示',
  group: '首页',
  docUrl: '',
  screenshot: '',
  devMode: 'proCode',
  npm: {
    package: 'hzdz-charts',
    version: '0.1.0',
    exportName: 'RealtimeStatus',
    main: 'src/index.tsx',
    destructuring: true,
    subName: ''
  },
  props: [
    {
      name: 'ref',
      propType: 'object',
    },
    {
      name: 'key',
      propType: 'string',
    },
    {
      name: 'style',
      propType: 'object',
    },
    {
      name: 'className',
      propType: 'string',
    },
    {
      name: 'width',
      propType: 'number',
      description: '容器宽度'
    },
    {
      name: 'height',
      propType: 'number',
      description: '容器高度'
    },
    {
      name: 'backgroundColor',
      propType: 'string',
      description: '容器背景色'
    },
    {
      name: 'borderRadius',
      propType: 'number',
      description: '容器圆角'
    },
    {
      name: 'labelText',
      propType: 'string',
      description: '标签文本'
    },
    {
      name: 'labelFontSize',
      propType: 'number',
      description: '标签字体大小'
    },
    {
      name: 'labelColor',
      propType: 'string',
      description: '标签颜色'
    },
    {
      name: 'labelFontWeight',
      propType: 'number',
      description: '标签字体粗细'
    },
    {
      name: 'labelFontFamily',
      propType: 'string',
      description: '标签字体'
    },
    {
      name: 'labelLetterSpacing',
      propType: 'number',
      description: '标签字间距'
    },
    {
      name: 'progressValue',
      propType: 'number',
      description: '进度值(0-100)'
    },
    {
      name: 'progressWidth',
      propType: 'number',
      description: '进度条宽度'
    },
    {
      name: 'progressHeight',
      propType: 'number',
      description: '进度条高度'
    },
    {
      name: 'progressGradientStart',
      propType: 'string',
      description: '进度条渐变色起始'
    },
    {
      name: 'progressGradientEnd',
      propType: 'string',
      description: '进度条渐变色结束'
    },
    {
      name: 'progressBackgroundColor',
      propType: 'string',
      description: '进度条背景色'
    },
    {
      name: 'progressBorderRadius',
      propType: 'number',
      description: '进度条圆角'
    },
    {
      name: 'indicatorSize',
      propType: 'number',
      description: '指示器大小'
    },
    {
      name: 'indicatorGradientStart',
      propType: 'string',
      description: '指示器渐变色起始'
    },
    {
      name: 'indicatorGradientEnd',
      propType: 'string',
      description: '指示器渐变色结束'
    },
    {
      name: 'indicatorBorderColor',
      propType: 'string',
      description: '指示器边框色'
    },
    {
      name: 'labelContainerWidth',
      propType: 'number',
      description: '标签容器宽度'
    },
    {
      name: 'labelContainerHeight',
      propType: 'number',
      description: '标签容器高度'
    },
    {
      name: 'labelContainerBackgroundColor',
      propType: 'string',
      description: '标签容器背景色'
    },
    {
      name: 'labelContainerBorderColor',
      propType: 'string',
      description: '标签容器边框色'
    },
    {
      name: 'labelContainerBorderRadius',
      propType: 'number',
      description: '标签容器圆角'
    },
    {
      name: 'labelContainerShadowColor',
      propType: 'string',
      description: '标签容器阴影色'
    },
    {
      name: 'labelContainerShadowBlur',
      propType: 'number',
      description: '标签容器阴影模糊'
    },
    {
      name: 'onClick',
      propType: 'func',
      description: '点击事件'
    }
  ],
  configure: {
    props: [
      // 容器配置
      {
        name: 'container',
        type: 'group',
        display: 'accordion',
        title: {
          label: '容器配置',
        },
        items: [
          {
            name: 'width',
            title: { label: '容器宽度' },
            setter: { componentName: 'NumberSetter', isRequired: false, initialValue: 400 }
          },
          {
            name: 'height',
            title: { label: '容器高度' },
            setter: { componentName: 'NumberSetter', isRequired: false, initialValue: 64 }
          },
          {
            name: 'backgroundColor',
            title: { label: '容器背景色' },
            setter: { componentName: 'ColorSetter', isRequired: false, initialValue: 'rgba(29,37,45,0.9)' }
          },
          {
            name: 'borderRadius',
            title: { label: '容器圆角' },
            setter: { componentName: 'NumberSetter', isRequired: false, initialValue: 8 }
          }
        ]
      },
      // 标签配置
      {
        name: 'label',
        type: 'group',
        display: 'accordion',
        title: {
          label: '标签配置',
        },
        items: [
          {
            name: 'labelText',
            title: { label: '标签文本' },
            setter: { componentName: 'StringSetter', isRequired: false, initialValue: '实时' }
          },
          {
            name: 'labelFontSize',
            title: { label: '标签字体大小' },
            setter: { componentName: 'NumberSetter', isRequired: false, initialValue: 16 }
          },
          {
            name: 'labelColor',
            title: { label: '标签颜色' },
            setter: { componentName: 'ColorSetter', isRequired: false, initialValue: '#6FBDFF' }
          },
          {
            name: 'labelFontWeight',
            title: { label: '标签字体粗细' },
            setter: { componentName: 'NumberSetter', isRequired: false, initialValue: 500 }
          },
          {
            name: 'labelFontFamily',
            title: { label: '标签字体' },
            setter: { componentName: 'StringSetter', isRequired: false, initialValue: 'SourceHanSansSC' }
          },
          {
            name: 'labelLetterSpacing',
            title: { label: '标签字间距' },
            setter: { componentName: 'NumberSetter', isRequired: false, initialValue: 0 }
          }
        ]
      },
      // 标签容器配置
      {
        name: 'labelContainer',
        type: 'group',
        display: 'accordion',
        title: {
          label: '标签容器配置',
        },
        items: [
          {
            name: 'labelContainerWidth',
            title: { label: '标签容器宽度' },
            setter: { componentName: 'NumberSetter', isRequired: false, initialValue: 58 }
          },
          {
            name: 'labelContainerHeight',
            title: { label: '标签容器高度' },
            setter: { componentName: 'NumberSetter', isRequired: false, initialValue: 30 }
          },
          {
            name: 'labelContainerBackgroundColor',
            title: { label: '标签容器背景色' },
            setter: { componentName: 'ColorSetter', isRequired: false, initialValue: '#0B1E2F' }
          },
          {
            name: 'labelContainerBorderColor',
            title: { label: '标签容器边框色' },
            setter: { componentName: 'ColorSetter', isRequired: false, initialValue: '#66B9FF' }
          },
          {
            name: 'labelContainerBorderRadius',
            title: { label: '标签容器圆角' },
            setter: { componentName: 'NumberSetter', isRequired: false, initialValue: 5 }
          },
          {
            name: 'labelContainerShadowColor',
            title: { label: '标签容器阴影色' },
            setter: { componentName: 'ColorSetter', isRequired: false, initialValue: '#008BFF' }
          },
          {
            name: 'labelContainerShadowBlur',
            title: { label: '标签容器阴影模糊' },
            setter: { componentName: 'NumberSetter', isRequired: false, initialValue: 11 }
          }
        ]
      },
      // 进度条配置
      {
        name: 'progress',
        type: 'group',
        display: 'accordion',
        title: {
          label: '进度条配置',
        },
        items: [
          {
            name: 'progressValue',
            title: { label: '进度值(0-100)' },
            setter: { 
              componentName: 'NumberSetter', 
              isRequired: false, 
              initialValue: 45,
              props: {
                min: 0,
                max: 100,
                step: 1
              }
            }
          },
          {
            name: 'progressWidth',
            title: { label: '进度条宽度' },
            setter: { componentName: 'NumberSetter', isRequired: false, initialValue: 301 }
          },
          {
            name: 'progressHeight',
            title: { label: '进度条高度' },
            setter: { componentName: 'NumberSetter', isRequired: false, initialValue: 12 }
          },
          {
            name: 'progressGradientStart',
            title: { label: '进度条渐变色起始' },
            setter: { componentName: 'ColorSetter', isRequired: false, initialValue: '#00FFF1' }
          },
          {
            name: 'progressGradientEnd',
            title: { label: '进度条渐变色结束' },
            setter: { componentName: 'ColorSetter', isRequired: false, initialValue: '#008BFF' }
          },
          {
            name: 'progressBackgroundColor',
            title: { label: '进度条背景色' },
            setter: { componentName: 'ColorSetter', isRequired: false, initialValue: '#3E4455' }
          },
          {
            name: 'progressBorderRadius',
            title: { label: '进度条圆角' },
            setter: { componentName: 'NumberSetter', isRequired: false, initialValue: 9 }
          }
        ]
      },
      // 指示器配置
      {
        name: 'indicator',
        type: 'group',
        display: 'accordion',
        title: {
          label: '指示器配置',
        },
        items: [
          {
            name: 'indicatorSize',
            title: { label: '指示器大小' },
            setter: { componentName: 'NumberSetter', isRequired: false, initialValue: 16 }
          },
          {
            name: 'indicatorGradientStart',
            title: { label: '指示器渐变色起始' },
            setter: { componentName: 'ColorSetter', isRequired: false, initialValue: '#00FFF1' }
          },
          {
            name: 'indicatorGradientEnd',
            title: { label: '指示器渐变色结束' },
            setter: { componentName: 'ColorSetter', isRequired: false, initialValue: '#008BFF' }
          },
          {
            name: 'indicatorBorderColor',
            title: { label: '指示器边框色' },
            setter: { componentName: 'ColorSetter', isRequired: false, initialValue: '#FFFFFF' }
          }
        ]
      }
    ],
    supports: {
      style: true,
      className: true,
      events: ['onClick']
    }
  }
};

const snippets: IPublicTypeSnippet[] = [
  {
    title: '实时状态',
    screenshot: '',
    schema: {
      componentName: 'RealtimeStatus',
      props: {
        width: 400,
        height: 64,
        backgroundColor: 'rgba(29,37,45,0.9)',
        borderRadius: 8,
        labelText: '实时',
        labelFontSize: 16,
        labelColor: '#6FBDFF',
        labelFontWeight: 500,
        labelFontFamily: 'SourceHanSansSC',
        labelLetterSpacing: 0,
        progressValue: 45,
        progressWidth: 301,
        progressHeight: 12,
        progressGradientStart: '#00FFF1',
        progressGradientEnd: '#008BFF',
        progressBackgroundColor: '#3E4455',
        progressBorderRadius: 9,
        indicatorSize: 16,
        indicatorGradientStart: '#00FFF1',
        indicatorGradientEnd: '#008BFF',
        indicatorBorderColor: '#FFFFFF',
        labelContainerWidth: 58,
        labelContainerHeight: 30,
        labelContainerBackgroundColor: '#0B1E2F',
        labelContainerBorderColor: '#66B9FF',
        labelContainerBorderRadius: 5,
        labelContainerShadowColor: '#008BFF',
        labelContainerShadowBlur: 11
      }
    }
  }
];

export default {
  ...RealtimeStatusMeta,
  snippets
}; 